<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>Layui-BeJSON.com</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/user_user/css/layui.css"  media="all">
    <link rel="stylesheet" type="text/css" href="/user_user/css/about.css">
</head>
<body>
              
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>乘客信息修改</legend>
</fieldset>
 
<form class="layui-form" id="messForm" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">姓名：</label>
        <div class="layui-input-inline">
          <input type="text" name="title" id="passName" autocomplete="off" placeholder="请输入您的姓名..." class="layui-input">
        </div>
      </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">手机号：</label>
            <div class="layui-input-inline">
                <input type="tel" name="phone" id="phone" autocomplete="off" placeholder="请输入您的手机号..." class="layui-input">
            </div>
        </div>
    </div>
  <div class="layui-form-item">
    <label class="layui-form-label">身份证号：</label>
    <div class="layui-input-inline">
      <input type="text" name="identity" id="userCode" placeholder="请输入您的身份证号..." class="layui-input">
    </div>
  </div>
    <div class="layui-form-item" pane="" style="margin-bottom: 0" >
        <label class="layui-form-label">性别：</label>
        <div class="layui-input-block">
            <input type="radio" name="sex" id="sexMale" value="男"  title="男">
            <input type="radio" name="sex" id="sexFemale" value="女" title="女">
        </div>
    </div>
    <div class="msg-box-container" style="color: #FF0000;font-size: 12px;">
        <span class="msg-box" id="msg-box" hidden="hidden"></span>
    </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button type="button" class="layui-btn" onclick="showPopup('确认要修改乘客信息吗?')">确认修改</button>
      <button type="button" class="layui-btn layui-btn-primary" onclick="resetBtn()">重置</button>
    </div>
  </div>
</form>
<script src="/user_user/js/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="/user_user/js/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/user_user/js/about.js"></script>
<script type="text/javascript" src="/user_user/js/editPass.js"></script>
<script>
    $(function () {
        getEditPassMess();
    })
    function resetBtn(){
        document.getElementById("messForm").reset();
        getEditPassMess();
    }
    function getEditPassMess(){
        $.ajax({
            url:window.location.protocol+"//"+window.location.host+"/user/doEditPass",
            type:"POST",
            async:false,
            contentType:"application/json;charset=UTF-8",
            success:function(data){
                $('#passName').val(data.data.passName);
                $('#phone').val(data.data.passPhone);
                $('#userCode').val(data.data.passCode);
                var sex = data.data.passSex;
                if (sex==0){
                   $("#sexMale").prop("checked","checked")
                }else{
                    $("#sexFemale").prop("checked","checked")
                }
                layui.use('form', function () {
                    var form = layui.form;
                    form.render()
                })
            },
            error:function(){
                alert("请求错误了");
            }
        });
    }
</script>
</body>
</html>